/*
 * @Author: yeyuyan yeyuyuan@ruijie.com.cn
 * @Date: 2025-04-02 10:42:36
 * @LastEditors: yeyuyan yeyuyuan@ruijie.com.cn
 * @LastEditTime: 2025-05-27 14:30:12
 * @FilePath: \ruigpt-web\src\pages\datasets\components\DeleteConfirmModal.tsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import React from 'react';
import { Modal, Button, Space } from 'antd';
import { t } from '@/locales/i18n';
import TipsModals from '@/components/modals/TipsModals';
import ModalsFooterBtn from '@/components/modals/ModalsFooterBtn';

interface DeleteConfirmModalProps {
  visible: boolean;
  loading?: boolean;
  text: string | React.ReactNode;
  onCancel: () => void;
  onConfirm: () => void;
  onCancelText?: string; // 可选参数
  onConfirmText?: string; // 可选参数
}

const DeleteConfirmModal: React.FC<DeleteConfirmModalProps> = ({
  visible,
  loading = false,
  text,
  onCancel,
  onConfirm,
  onCancelText = t('page.homePage.cancel'), // 默认值
  onConfirmText = t('page.homePage.del'), // 默认值
}) => {
  return (
    <TipsModals
      open={visible}
      onCancel={onCancel}
      closable={false}
      width={300}
      onOk={onConfirm}
      footer={
        <div
          style={{ textAlign: 'center', justifyContent: 'center', alignItems: 'center' }}
          className="py-3"
        >
          <Space size={30}>
            <ModalsFooterBtn onClick={onCancel}>{onCancelText}</ModalsFooterBtn>
            <ModalsFooterBtn type="primary" danger loading={loading} onClick={onConfirm}>
              {onConfirmText}
            </ModalsFooterBtn>
            {/* <Button onClick={onCancel}>{onCancelText}</Button>
            <Button type="primary" danger loading={loading} onClick={onConfirm}>
              {onConfirmText}
            </Button> */}
          </Space>
        </div>
      }
    >
      <div
        style={{
          display: 'flex',
          justifyContent: 'center',
          alignItems: 'center',
          height: '80px',
        }}
      >
        <p style={{ textAlign: 'center' }}>{text}</p>
      </div>
    </TipsModals>
  );
};

export default DeleteConfirmModal;
